package com.ipet.manage.controller.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ipet.manage.pojo.Item;
import com.ipet.manage.service.ItemService;


@Controller
@RequestMapping("/web/item")
public class WebItemController {
	
	@Autowired
	private ItemService itemService;
	
	@RequestMapping(method=RequestMethod.GET,value="/{itemId}",produces = MediaType.APPLICATION_JSON_VALUE)
	@ResponseBody
	public Item findItemById(@PathVariable Long itemId){
		Item item = itemService.findItemById(itemId);
		return item;
	}
}
